<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
            <title>
                @yield('title')
            </title>
            <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
                <meta content="" name="keywords">
                    <meta content="" name="description">
                        <link href="/style/res/css/layui.css" rel="stylesheet"></link>
                        <link href="/style/res/css/global.css" rel="stylesheet"></link>
                        <link href="/style/common/css/paginate.css" rel="stylesheet"></link>
                    </meta>
                </meta>
            </meta>
        </meta>
    </head>
    <body>
        <div >
            <div class="fly-header layui-bg-black">
                <div class="layui-container">
                    <a class="fly-logo" href="/">
                        <img alt="layui" src="/style/res/images/logo.png">
                        </img>
                    </a>
                </div>
            </div>

            <div class="fly-panel fly-column">
                <div class="layui-container">
                    <ul class="layui-clear">
                        <li class="layui-hide-xs 
                            @if(!$searchData['search_field'])
                                layui-this
                            @endif"
                        >

                            <a href="{{url('home/article/index')}}">
                                首页
                            </a>

                        </li>
                        @foreach($categoryList as $k=>$v)
                        <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block">
                            <span class="fly-mid">
                            </span>
                        </li>

                        <li  class="@if($searchData['search_field']=='category_id' && $searchData['search_content']==$v['id'])
                                        layui-this
                                    @endif"
                        >

                            <a href="{{route('home/article/index',['search_field'=>'category_id','search_content'=>$v['id']])}}">
                                {{$v['title']}}
                            </a>

                        </li>
                        @endforeach
                  
                

                    </ul>
                    <div class="fly-column-right layui-hide-xs">
                        <form action="{{url('home/article/index')}}">
                            <input type="text" placeholder="  请输入搜索的文章标题！" name="search_content" 
                                value="@if($searchData['search_field']=='title') {{$searchData['search_content']}} @endif" 
                                style="height: 36px;width: 255px;border: 1px #dfdfdf solid;border-radius: 10px;"
                            >
                            <input type="hidden" name="search_field" value="title">
                            <button class="layui-btn"  >
                                搜索文章
                                <i class="layui-icon">
                                    
                                </i>
                            </button>
                        </form>
                    </div>
           
                </div>
            </div>
            <div class="layui-container">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md8">
                        @yield('content')
                    </div>
                    <div class="layui-col-md4">

                        <dl class="fly-panel fly-list-one">
                            <dt class="fly-panel-title">
                                本周推荐
                            </dt>
                            @if($recommendArticleList->total())
                                @foreach($recommendArticleList as $k=>$v)
                                <dd>
                                    <a class="layui-badge" style="background-color: #5fb878;" href="#">
                                        {{$v->category->title}}
                                    </a>
                                    <a href="{{url('home/article/detail',[$v['id']])}}">
                                        {{$v['title']}}
                                    </a>
                                </dd>
                                @endforeach
                            @else
                            <!-- 无数据时 -->
                            <div class="fly-none">没有相关数据</div>  
                            @endif
                        </dl>
                        <!-- <div class="fly-panel">
                            <div class="fly-panel-title">
                                这里可作为广告区域
                            </div>
                            <div class="fly-panel-main">
                                <a class="fly-zanzhu" href="http://layim.layui.com/?from=fly" style="background-color: #5FB878;" target="_blank" time-limit="2017.09.25-2099.01.01">
                                    LayIM 3.0 - layui 旗舰之作
                                </a>
                            </div>
                        </div> -->
                        <div class="fly-panel fly-link">
                            <h3 class="fly-panel-title">
                                友情链接
                            </h3>
                            <dl class="fly-panel-main">
                            @if($friendlyLinkList->total())
                                @foreach($friendlyLinkList as $k => $v )
                                <dd>
                                    <a href="{{$v['url']}}" target="_blank">
                                        {{$v['title']}}
                                    </a>
                                </dd>
                                @endforeach
                            @else
                            <!-- 无数据时 -->
                            <div class="fly-none">没有相关数据</div>  
                            @endif
                            </dl>
                        </div>
                    </div>
                </div>
            </div>
       
            <div class="fly-footer"> lgbya博客！ </div>
        </div>
        <script src="/style/res/plug/jq/jquery.js"></script>
        <script src="/style/res/plug/layer/layer.js"></script>
        <script src="/style/res/plug/layui/layui.js"></script>

    </body>
</html>
@yield('js')